package com.urbainski.componentes.form
{
	import flash.events.Event;
	import flash.events.EventDispatcher;

	public class CSDispatcher extends EventDispatcher
	{
		
		/**
		 * @author Cristian Elder Urbainski
		 * @since 20/12/2011
		 */
		
		private static var _instance:CSDispatcher;
		
		public function CSDispatcher()
		{
			super();
		}
		
		public static function getInstance() : CSDispatcher
		{
			if (_instance == null)
			{
				_instance = new CSDispatcher;
			}
			return _instance;
		}
		
		public static function dispatchEvent(event:Event) : void
		{
			getInstance().dispatchEvent(event);
		}
		
		public static function addEventListener(type:String, listener:Function) : void
		{
			getInstance().addEventListener(type, listener);
		}
		
		public static function removeEventListener(type:String, listener:Function) : void
		{
			getInstance().removeEventListener(type, listener);
		}
	}
}